const Router = require("koa-router");
const page = new Router();
const defender = require("../../middleware/defender");

page.get("/login", async (ctx) => {
    if (ctx.session.user) {
        return ctx.redirect("/");
    }
    await ctx.render("login");
});

page.get("/", defender, async (ctx) => {
    await ctx.render("index");
});

module.exports = page;
